<template>
	<div>
		<div class="crumbs">
			<h2 class="">商家列表</h2>
		</div>
		<div class="container">
			<div class="handle-box">
				<el-form :model="query" label-width="80px" class="ipt row-me">
					<el-form-item label="地区">
						<el-cascader v-model="query.city" :options="areaList"
							:props="{emitPath: false,value: 'adcode', label: 'name', checkStrictly: true }"></el-cascader>
					</el-form-item>
					<el-form-item label="业务员">
						<el-select v-model="query.businessId" placeholder="请选择业务员" clearable>
							<el-option v-for="(item,index) in salesmanList" :key="index" :value="item.id" :label="item.name">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="认证日期" class="">
						<!-- <el-date-picker v-model="dateList" type="daterange" range-separator="至" start-placeholder="开始日期"
							end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="onChange">
						</el-date-picker> -->
						<el-date-picker v-model="dateList" style="width: 380px;margin-right: 20px;" type="datetimerange"
							range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
							@change="onChange">
						</el-date-picker>
					</el-form-item>
					<el-form-item label="机构名称">
						<el-input v-model="query.organName" placeholder="请输入机构名称"></el-input>
					</el-form-item>
				</el-form>

				<el-button type="primary" @click="handleSearch">查询</el-button>
				<el-button @click="resetClick">重置</el-button>
				<el-button type="primary" class="handle-del" @click="handleAdd">+
					新增商家
				</el-button>
				<el-button type="primary" class="handle-del mr10" @click="delAllSelection">批量修改业务员
				</el-button>

			</div>
			<el-table :data="tableData" border class="table" ref="multipleTable" header-cell-class-name="table-header"
				@selection-change="handleSelectionChange">
				<el-table-column type="selection" width="40" align="center"></el-table-column>
				<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
				<el-table-column prop="name" label="机构信息" align="center" width="200">
					<template slot-scope="scope">
						<div class="row-me center-all">
							<el-image class="width80 height80 margin-right10" :src="scope.row.organImg" fit=" scale-down "
								:preview-src-list="[scope.row.organImg]">
							</el-image>
							<div class="">{{scope.row.organName}}</div>
						</div>
					</template>
				</el-table-column>
				<el-table-column label="所属区域">
					<template slot-scope="{row}">
						<span>{{row.provinceName}}{{row.cityName}}{{row.regionName}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="trainAddress" label="地址" align="center" show-overflow-tooltip></el-table-column>
				<el-table-column prop="sort" label="会员状态" align="center">

					<template slot-scope="scope">
						<div class="">
							<!-- 0未认证1认证机构2金牌机构3钻石机构4不显示 -->
							<div class="" v-if="!$.isEmpty(scope.row.organWrit)">
								笔试：
								<span v-if="scope.row.organWrit == 0">未认证</span>
								<span v-if="scope.row.organWrit == 1">认证机构</span>
								<span v-if="scope.row.organWrit == 2">金牌机构</span>
								<span v-if="scope.row.organWrit == 3">钻石机构</span>
								<span v-if="scope.row.organWrit == 4">不显示</span>
							</div>

							<div class="" v-if="!$.isEmpty(scope.row.organInter)">
								面试：
								<span v-if="scope.row.organInter == 0">未认证</span>
								<span v-if="scope.row.organInter == 1">认证机构</span>
								<span v-if="scope.row.organInter == 2">金牌机构</span>
								<span v-if="scope.row.organInter == 3">钻石机构</span>
								<span v-if="scope.row.organInter == 4">不显示</span>
							</div>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="interTime" label="到期日期" align="center">
					<template slot-scope="scope">
						<div class="">
							<!-- 0未认证1认证机构2金牌机构3钻石机构4不显示 -->
							<div class="" v-if="!$.isEmpty(scope.row.writTime)">
								笔试：
								<span>{{scope.row.writTime}}</span>
							</div>

							<div class="" v-if="!$.isEmpty(scope.row.interTime)">
								面试：
								<span>{{scope.row.interTime}}</span>

							</div>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="学员评价" align="center">
					<template slot-scope="scope">
						<span class="" @click="lookReviews(scope.$index, scope.row)" style="color: #409EFF;cursor: pointer"
							v-if="scope.row.comments.length>0">查看评价({{scope.row.comments.length}})</span>
					</template>
				</el-table-column>
				<el-table-column label="认证价格" align="center">
					<template slot-scope="scope">
						<div v-if="scope.row.writPrice">笔试：{{scope.row.writPrice}}</div>
						<div v-if="scope.row.interPrice">面试：{{scope.row.interPrice}}</div>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="业务员" align="center">
					<template slot-scope="scope">
						<span class="" @click="revampSalesman(scope.$index, scope.row)" style="color: #409EFF;cursor: pointer"
							v-if="!$.isEmpty(scope.row.adminUser)">{{scope.row.adminUser.name}}/{{scope.row.adminUser.mobile}}</span>
						<span style="color: #409EFF;cursor: pointer" @click="revampSalesman(scope.$index, scope.row)"
							v-else>去绑定</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="商家二维码" align="center">
					<template slot-scope="scope">
						<span class="" @click="handleAppExamQrcode(scope.$index, scope.row)"
							style="color: #409EFF;cursor: pointer;">二维码</span>
					</template>
				</el-table-column>
				<el-table-column prop="label" label="认证标签" align="center">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.authStatus" @click.native="labelClick(scope.row)"></el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" width="160" align="center">
					<template slot-scope="scope">
						<!-- 0下线1上线organStatus -->
						<!-- <el-button type="text" @click="topThread(scope.$index, scope.row)"
							v-if="scope.row.organStatus == 1">上线</el-button>
						<el-button type="text" @click="topThread(scope.$index, scope.row)"
							v-if="scope.row.organStatus == 0">下线</el-button> -->

						<el-button type="text" @click="handleEdit(scope.$index, scope.row,1),(dialogTitle = '编辑商家')">编辑
						</el-button>
						<el-button type="text" @click="handleEdit(scope.$index, scope.row,2),(dialogTitle = '商家详情')">详情
						</el-button>

						<el-dropdown>
							<span class="el-dropdown-link" style="color: #1890ff;">更多</span>
							<el-dropdown-menu slot="dropdown" align="center" style="color: #1890ff;">
								<el-dropdown-item @click.native="administratorClick(scope.row)"><span>绑定管理员</span></el-dropdown-item>
								<el-dropdown-item @click.native="classesClick(scope.row)"><span>班次管理</span></el-dropdown-item>
								<el-dropdown-item @click.native="practiceDaily(scope.row.id)">每日一练设置</el-dropdown-item>
								<el-dropdown-item @click.native="clickDel(scope.row.id)">删除</el-dropdown-item>
							</el-dropdown-menu>
						</el-dropdown>

						<!-- <el-popconfirm title="确定删除？" @confirm="clickDel(scope.row.id)">
							<el-button type="text" slot="reference">删除</el-button>
						</el-popconfirm> -->

					</template>
				</el-table-column>
			</el-table>
			<div class="pagination">
				<el-pagination background layout="total, prev, pager, next" :current-page="query.pageNumber"
					:page-size="query.pageSize" :total="pageTotal" @current-change="handlePageChange"></el-pagination>
			</div>
		</div>

		<!-- 新建商家弹出框 -->
		<el-dialog :title="dialogTitle" :visible.sync="shopsShow" v-if="shopsShow" width="60%" class="shopsBox">
			<!-- style="pointer-events: none;" -->
			<el-tabs v-model="activeName" style="pointer-events: none;">
				<el-tab-pane label="基础信息" name="one"></el-tab-pane>
				<el-tab-pane label="笔试" name="two" v-if="shopsIndexList.includes(2) == true"></el-tab-pane>
				<el-tab-pane label="面试" name="three" v-if="shopsIndexList.includes(3) == true"></el-tab-pane>
				<el-tab-pane label="其他设置" name="four"></el-tab-pane>
				<el-tab-pane label="详情信息" name="five"></el-tab-pane>
			</el-tabs>
			<el-form ref="shopsForm" :model="shopsForm" label-width="120px">
				<!-- 66666666666666666 -->
				<!-- 基础信息 -->
				<div class="" v-if="activeName == 'one'">
					<div class="row-me row-center">
						<el-form-item label="机构名字" :required="true" label-width="120px" class="width100Per" porp="organName">
							<el-input v-model="shopsForm.organName" :disabled="isDisabled" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<el-form-item label="公司名称" :required="true" label-width="120px" porp="organName">
						<el-input v-model="shopsForm.companyName" :disabled="isDisabled" placeholder="请输入"></el-input>
					</el-form-item>
					<!-- <el-form-item label="上传营业执照" label-width="120px">
						<div class="videoBox">
							<el-upload class="" action="" accept=".png" list-type="picture-card" :show-file-list="false"
								:before-upload="charterUpload" :auto-upload="true" :http-request="charterFile">
								<img v-if="shopsForm.companyImg" :src="shopsForm.companyImg"
									class="width100Per height100Per">
								<i v-else class="el-icon-plus"></i>
							</el-upload>
							<i class="el-icon-delete delBox" @click="delCharter" v-if="shopsForm.companyImg"></i>
						</div>
					</el-form-item> -->
					<el-form-item label="一句话简介" label-width="120px">
						<el-input type="textarea" v-model="shopsForm.oneComment" :disabled="isDisabled" maxlength="30"
							placeholder="请输入"></el-input>
					</el-form-item>

					<div class="row-me row-center">
						<el-form-item label="宣传视频" label-width="120px">
							<div class="videoBox" v-if="isDisabled == false">
								<el-upload class="avatar-uploader" action="" accept=".mp4" list-type="picture-card"
									:show-file-list="false" :before-upload="videoUpload" :auto-upload="true" :http-request="videoFile">
									<video v-if="shopsForm.publicityVideo" :src="shopsForm.publicityVideo"
										class="width100Per height100Per"></video>
									<i v-else class="el-icon-plus"></i>
								</el-upload>
								<i class="el-icon-delete delBox" @click="delvideo" v-if="shopsForm.publicityVideo"></i>
							</div>
							<div class="font-size10" v-if="isDisabled == false">建议视频尺寸：4:3 格式为.mp4 不超过1G</div>

							<div class="videoBox" v-if="isDisabled == true">
								<video v-if="shopsForm.publicityVideo" :src="shopsForm.publicityVideo"
									class="width100Per height100Per"></video>
							</div>

						</el-form-item>
					</div>
					<el-form-item label="宣传图片" label-width="120px" :required="true">
						<div class="videoBox1 floatLeft margin-right10" v-if="shopsForm.publicityImg1.length>0"
							v-for="(item,index) in shopsForm.publicityImg1" :key="index">
							<el-image class="width100 height100 radius6 margin-right10" fit="scale-down" :src="item"
								:preview-src-list="[item]"></el-image>
							<i class="el-icon-delete delBox" @click="delPublicity(index)" v-if="isDisabled == false"></i>
						</div>
						<el-button type="text" @click="clickImg" v-if="isDisabled == false">点击图片库</el-button>

					</el-form-item>

					<el-form-item label="机构封面图" label-width="120px" :required="true">
						<el-image v-if="shopsForm.organImg" fit="scale-down" class="width100 height100 radius6 margin-right10"
							:src="shopsForm.organImg" :preview-src-list="[shopsForm.organImg]"></el-image>
						<el-button type="text" @click="clickImg1" v-if="isDisabled == false">点击图片库</el-button>
					</el-form-item>

					<el-form-item label="培训年限" label-width="120px" class="width100Per" :required="true">
						<el-input v-model="shopsForm.trainYear" :disabled="isDisabled" placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="企业联系电话" label-width="120px" class="width100Per" :required="true">
						<el-input v-model="shopsForm.companyPhone" :disabled="isDisabled" placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="商家微信" label-width="120px" class="width100Per">
						<el-input v-model="shopsForm.weChat" :disabled="isDisabled" placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="培训地址" label-width="120px" class="width100Per" :required="true">
						<div class="posRelative" v-if="isDisabled == false">
							<el-input v-model="shopsForm.trainAddress" :disabled="true" placeholder="点击获取培训地址"></el-input>
							<div class="posAbsolute height50 width100Per" style="z-index:999;top:0" @click="trainClick">
							</div>
						</div>
						<div class="" v-if="isDisabled == true">
							<el-input v-model="shopsForm.trainAddress" :disabled="true" placeholder="点击获取培训地址"></el-input>
						</div>
					</el-form-item>

					<el-form-item label="认证类型" label-width="120px" class="width100Per" :required="true">
						<el-select v-model="shopsForm.authType" :disabled="isDisabled" placeholder="请选择" clearable
							class="width100Per" @change="auTypeChange">
							<el-option :label="item.name" :value="item.id" v-for="(item,index) in auTypeList"
								:key="index"></el-option>
						</el-select>
					</el-form-item>

					<el-form-item label="所属区域" label-width="120px" class="width100Per" :required="true">
						<el-cascader v-model="shopsForm.area" :options="areaList"
							:props="{ value: 'adcode', label: 'name', expandTrigger: 'hover' }" class="width100Per"
							:disabled="isDisabled"></el-cascader>
					</el-form-item>

					<el-form-item label="地址说明" label-width="120px" :required="true">
						<el-input type="textarea" v-model="shopsForm.addressComment" :disabled="isDisabled" maxlength="30"
							placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="是否显示评价" :required="true">
						<!-- 0否1是 -->
						<el-radio-group v-model="shopsForm.isComment" :disabled="isDisabled">
							<el-radio label="1">是</el-radio>
							<el-radio label="0">否</el-radio>
						</el-radio-group>
					</el-form-item>

					<el-form-item label="学校风采" label-width="120px">
						<div class="videoBox1 floatLeft margin-right10" v-if="shopsForm.schoolVideo1.length>0"
							v-for="(item,index) in shopsForm.schoolVideo1" :key="index">
							<el-image fit="scale-down" class="width100 height100 radius6 margin-right10" :src="item"
								:preview-src-list="[shopsForm.schoolVideo1]"></el-image>
							<i class="el-icon-delete delBox" @click="delPublicity2(index)" v-if="isDisabled == false"></i>
						</div>
						<el-button type="text" @click="clickImg2" :disabled="isDisabled">点击图片库</el-button>
					</el-form-item>
					<el-button type="primary" class="margin-left120" @click="oneClick()">下一步</el-button>
				</div>
				<!-- 笔试 -->
				<div class="" v-if="activeName == 'two'">
					<el-form-item label="会员级别" :required="true">
						<!-- 笔试状态0未认证1认证机构2金牌机构3钻石机构4不显示 -->
						<el-radio-group v-model="shopsForm.organWrit" :disabled="isDisabled" @change="(val)=>organChange(val,1)">
							<el-radio :label="1">认证机构</el-radio>
							<el-radio :label="2">金牌机构</el-radio>
							<el-radio :label="3">钻石机构</el-radio>
							<el-radio :label="0">未认证</el-radio>
						</el-radio-group>
					</el-form-item>
					<div v-if="shopsForm.organWrit == 0">
						<div class="row-me row-center">
							<el-form-item label="未认证弹窗提醒" label-width="160px">
								<el-switch v-model="shopsForm.popWrit1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
							<el-form-item label="显示未认证图标" label-width="160px">
								<el-switch v-model="shopsForm.authenWrit1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
						</div>
						<div class="row-me row-center">
							<el-form-item label="提醒设置" label-width="120px">
								<el-switch v-model="shopsForm.hintWrit" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
							<el-input v-model="shopsForm.writComment" :disabled="isDisabled" placeholder="请输入提醒文字"
								class="width500 margin-bottom20 margin-left20" v-if="shopsForm.hintWrit"></el-input>
						</div>
					</div>
					<div v-else>
						<div class="row-me row-center">
							<el-form-item label="商家标签" label-width="120px">
								<el-select v-model="shopsForm.labelWrit" :disabled="isDisabled" placeholder="请选择" class="width300"
									clearable>
									<el-option :label="item.name" :value="item.id" v-for="(item,index) in tagList"
										:key="index"></el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="会员价格" label-width="120px" class="" :required="true">
								<el-input v-model="shopsForm.writPrice" :disabled="isDisabled" placeholder="请输入"
									class="width300"></el-input>
							</el-form-item>
						</div>
						<div class="row-me row-center expireBox">
							<el-form-item label="到期时间" label-width="120px" :required="true">
								<el-date-picker v-model="shopsForm.writTime" :disabled="isDisabled" type="date"
									value-format="yyyy-MM-dd" placeholder="选择日期" @change="dateChange()">
								</el-date-picker>
							</el-form-item>
							<el-form-item label="标签管理" label-width="120px" class="">
								<el-select v-model="shopsForm.writLabel" :disabled="isDisabled" multiple filterable allow-create
									default-first-option placeholder="请输入(输入后回车选择)" class="width300" @change="onShopChange">
									<el-option v-for="(item,index) in labelList" :key="index" :label="item.name" :value="item.id">
									</el-option>
								</el-select>
							</el-form-item>
						</div>
						<el-form-item label="是否显示班次" label-width="120px" :required="true">
							<!-- writClass 	笔试是否显示班次0否1是-->
							<el-switch v-model="shopsForm.writClass1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
						</el-form-item>
					</div>

					<el-button class="margin-left120" @click="twoClickS()">上一步</el-button>
					<el-button type="primary" @click="twoClickX()">下一步</el-button>
				</div>

				<!-- 面试 -->
				<div class="" v-if="activeName == 'three'">
					<el-form-item label="会员级别" :required="true">
						<!-- 笔试状态0未认证1认证机构2金牌机构3钻石机构4不显示 -->
						<el-radio-group v-model="shopsForm.organInter" :disabled="isDisabled" @change="(val)=>organChange(val,2)">
							<el-radio :label="1">认证机构</el-radio>
							<el-radio :label="2">金牌机构</el-radio>
							<el-radio :label="3">钻石机构</el-radio>
							<el-radio :label="0">未认证</el-radio>
						</el-radio-group>
					</el-form-item>
					<div v-if="shopsForm.organInter == 0">
						<div class="row-me row-center">
							<el-form-item label="未认证弹窗提醒" label-width="160px">
								<el-switch v-model="shopsForm.popInter1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
							<el-form-item label="显示未认证图标" label-width="160px">
								<el-switch v-model="shopsForm.authenInter1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
						</div>
						<div class="row-me row-center">
							<el-form-item label="提醒设置" label-width="120px">
								<el-switch v-model="shopsForm.hintInter" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
							</el-form-item>
							<el-input v-model="shopsForm.interComment" :disabled="isDisabled" placeholder="请输入提醒文字,设置个默认的"
								class="width500 margin-bottom20 margin-left20" v-if="shopsForm.hintInter"></el-input>
						</div>
					</div>
					<div v-else>
						<div class="row-me row-center">
							<el-form-item label="商家标签" label-width="120px">
								<el-select v-model="shopsForm.labelInter" :disabled="isDisabled" placeholder="请选择" class="width300"
									clearable>
									<el-option :label="item.name" :value="item.id" v-for="(item,index) in tagList"
										:key="index"></el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="会员价格" label-width="120px" class="" :required="true">
								<el-input v-model="shopsForm.interPrice" :disabled="isDisabled" placeholder="请输入"
									class="width300"></el-input>
							</el-form-item>
						</div>
						<div class="row-me row-center expireBox">
							<el-form-item label="到期时间" label-width="120px" :required="true">
								<el-date-picker v-model="shopsForm.interTime" :disabled="isDisabled" type="date"
									value-format="yyyy-MM-dd" placeholder="选择日期" @change="dateChange">
								</el-date-picker>
							</el-form-item>
							<el-form-item label="标签管理" label-width="120px" class="">
								<el-select v-model="shopsForm.interLabel1" :disabled="isDisabled" multiple filterable allow-create
									default-first-option placeholder="请输入(输入后回车选择)" class="width300" @change="onShopChange">
									<el-option v-for="(item,index) in labelList" :key="index" :label="item.name" :value="item.id">
									</el-option>
								</el-select>
							</el-form-item>
						</div>
						<el-form-item label="是否显示班次" label-width="120px" :required="true">
							<!-- interClass  面试是否显示班次0否1是-->
							<el-switch v-model="shopsForm.interClass1" :disabled="isDisabled" @change="$forceUpdate()"></el-switch>
						</el-form-item>
					</div>
					<el-button class="margin-left120" @click="threeClickS()">上一步</el-button>
					<el-button type="primary" @click="threeClickX()">下一步</el-button>
				</div>

				<!-- 其他设置 -->
				<div class="" v-if="activeName == 'four'">
					<div class="row-me flex-wrap">
						<el-form-item label="虚拟浏览量">
							<div class="row-me row-center">
								<el-input placeholder="请输入" type="number" v-model="shopsForm.virtualBrows" :disabled="isDisabled"
									class="width200 margin-right20"></el-input>
							</div>
						</el-form-item>
						<el-form-item label="自增设置" label-width="80px">
							<div class="row-me row-center">
								<el-switch v-model="shopsForm.switch1" :disabled="isDisabled" class="margin-right20 line-height40"
									@change="$forceUpdate()"></el-switch>
								<div class="row-me row-center" v-if="shopsForm.switch1">
									<el-input class="width100" v-model="shopsForm.browsMin" :disabled="isDisabled"
										placeholder="请输入"></el-input>
									<span class="margin-left5 margin-right5">~</span>
									<el-input class="width100" v-model="shopsForm.browsMax" :disabled="isDisabled"
										placeholder="请输入"></el-input>
									<el-select placeholder="请选择" v-model="shopsForm.browsTime" :disabled="isDisabled"
										class="margin-left20">
										<el-option label="每30分钟" :value="1"></el-option>
										<el-option label="每小时" :value="2"></el-option>
										<el-option label="每天" :value="3"></el-option>
									</el-select>
								</div>
							</div>
						</el-form-item>
					</div>
					<div class="row-me flex-wrap">
						<el-form-item label="虚拟收藏量">
							<div class="row-me row-center">
								<el-input placeholder="请输入" type="number" v-model="shopsForm.virtualCollect" :disabled="isDisabled"
									class="width200 margin-right20"></el-input>
							</div>
						</el-form-item>
						<el-form-item label="自增设置" label-width="80px">
							<div class="row-me row-center">
								<el-switch v-model="shopsForm.switch2" :disabled="isDisabled" class="margin-right20 line-height40"
									@change="$forceUpdate()"></el-switch>
								<div class="row-me row-center" v-if="shopsForm.switch2">
									<el-input class="width100" v-model="shopsForm.collectMin" :disabled="isDisabled"
										placeholder="请输入"></el-input>
									<span class="margin-left5 margin-right5">~</span>
									<el-input class="width100" v-model="shopsForm.collectMax" :disabled="isDisabled"
										placeholder="请输入"></el-input>
									<el-select placeholder="请选择" v-model="shopsForm.collectTime" :disabled="isDisabled"
										class="margin-left20">
										<el-option label="每30分钟" :value="1"></el-option>
										<el-option label="每小时" :value="2"></el-option>
										<el-option label="每天" :value="3"></el-option>
									</el-select>
								</div>
							</div>
						</el-form-item>
					</div>
					<div class="row-me flex-wrap">
						<el-form-item label="固定评分">
							<el-radio-group v-model="shopsForm.scoreStatus" :disabled="isDisabled">
								<el-radio label="1">是</el-radio>
								<el-radio label="0">否</el-radio>
							</el-radio-group>
						</el-form-item>
						<el-input class="width100 margin-left20" maxlength="5"
							onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,1})?).*$/g, '$1')" v-model="shopsForm.score"
							:disabled="isDisabled" placeholder="请输入" @input="handlerChange"></el-input>
						<div class="margin-left10 margin-top10" v-if="shopsForm.score>0">
							<el-rate v-model="shopsForm.scoreNum1" disabled allow-half text-color="#ff9900">
							</el-rate>
						</div>
					</div>

					<el-form-item label="业务员" :required="true">
						<el-select v-model="shopsForm.businessId" :disabled="isDisabled" filterable placeholder="请选择"
							class="width400">
							<el-option v-for="(item,index) in salesmanList" :key="index" :value="item.id" :label="item.name">
							</el-option>
						</el-select>
					</el-form-item>

					<el-button class="margin-left120" @click="fourClickS()">上一步</el-button>
					<el-button type="primary" @click="fourClickX()">下一步</el-button>
				</div>

				<!-- 详情信息 -->
				<div class="" v-if="activeName == 'five'">
					<el-form-item label="详情" :required="true" label-width="80px">
						<div class="row-me">
							<vue-ueditor-wrap v-model="shopsForm.showComment" editor-id="editor" :config="editorConfig"
								:editorDependencies="['ueditor.config.js','ueditor.all.js']" style="width: 80%;" />
						</div>
					</el-form-item>
					<el-button class="margin-top50" @click="fiveClickS()">上一步</el-button>
					<el-button type="primary" @click="fiveSubmit()" v-if="isDisabled ==false">提交</el-button>
				</div>

			</el-form>
			<!-- <span slot="footer" class="dialog-footer" v-if="activeName == 'five'">
				<el-button @click="shopsShow = false">取 消</el-button>
				<el-button type="primary" @click="addQuestionSort()">确 定</el-button>
			</span> -->
		</el-dialog>

		<!-- 二维码弹框 -->
		<el-dialog title="二维码" :visible.sync="qrcodeVisible" v-if="qrcodeVisible" width="40%">
			<div class="column-me center-all">
				<div class="row-me">
					<div class="shijuan">
						商家二维码 ：
					</div>
					<div> <span></span>
						<div class="row-me flex-end2">
							<div id="qrCode">
								<div id="code" ref="appExamQrCodeUrl" title="" align="center" class="margin-top10 ">
								</div>
							</div>
							<span class="margin-left10 pointer" @click="handleDownloadAppExamQrIMg('code')"> <i
									class="el-icon-download"></i>点击下载二维码</span>
						</div>
					</div>
				</div>

			</div>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="qrcodeVisible = false">关闭</el-button>
				<!-- <el-button @click="handleDownloadQrIMg">下载</el-button> -->
			</span>
		</el-dialog>
		<!-- 学员评价弹框 -->
		<el-dialog title="学员评价" :visible.sync="reviewsShow" v-if="reviewsShow" width="60%">
			<el-table :data="reviewsList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column type="expand">
					<template slot-scope="props" v-if="!$.isEmpty(props.row.images)">
						<el-form label-position="left" inline class="demo-table-expand">
							<el-form-item label="">
								<el-image :src="item" v-for="(item,index) in props.row.images.split(',')" :key="index"
									:preview-src-list="[item]" class="width100 height100 margin-right10"></el-image>
							</el-form-item>
						</el-form>
					</template>
				</el-table-column>
				<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
				<el-table-column label="用户头像/昵称/用户ID" align="center">
					<template slot-scope="scope">
						<div class="row-me center-all">
							<el-image class="width40 height40" :src="scope.row.userIcon"
								:preview-src-list="[scope.row.userIcon]"></el-image>
							<span>/{{scope.row.userName}}/{{scope.row.userId}}</span>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="content" label="评论内容" show-overflow-tooltip>
					<template slot-scope="scope">
						<div class="" v-if="!$.isEmpty(scope.row.content) && scope.row.randType == 1">
							<div class="margin-bottom5" v-for="(item,index) in JSON.parse(scope.row.content)" :key="index">
								{{item.name}}:{{item.content}}
							</div>
						</div>
						<div class="" v-else>
							{{scope.row.content}}
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="thumbUp" label="点赞数"></el-table-column>
				<el-table-column prop="userPhone" label="用户手机号"></el-table-column>
				<el-table-column prop="createTime" label="评价时间"></el-table-column>
			</el-table>

			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="reviewsShow = false">关闭</el-button>
			</span>
		</el-dialog>
		<!-- 业务员弹框 -->
		<el-dialog title="修改绑定业务员" :visible.sync="salesmanShow" v-if="salesmanShow" width="60%">
			<div class="row-me row-center">
				<el-form :model="salesmanForm" label-width="140px" class="ipt row-me">
					<el-form-item label="业务员姓名、电话:">
						<el-input v-model="salesmanForm.key" placeholder="请输入业务员姓名、电话"></el-input>
					</el-form-item>
				</el-form>
				<div class="margin-bottom20 margin-left20">
					<el-button type="primary" @click="salesmanSearch">查询</el-button>
					<el-button @click="salesmanResetClick">重置</el-button>
				</div>

			</div>
			<el-table :data="salesmanList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
				<el-table-column prop="name" label="姓名" align="center"></el-table-column>
				<el-table-column prop="mobile" label="电话" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="regionComment" label="地区" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="thumbUp" label="状态" align="center">
					<template slot-scope="scope">
						<span class="" style="color: rgb(45, 236, 34);" v-if="scope.row.entryStatus == 1">在职</span>
						<span class="" style="color: rgb(242, 42, 23);" v-else>离职</span>
					</template>
				</el-table-column>
				<el-table-column prop="entryStart" label="入职日期" align="center"></el-table-column>
				<el-table-column prop="entryEnd" label="离职日期" align="center"></el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button type="text" @click="boundClick1(scope.$index, scope.row)"
							v-if="scope.row.organStatus == true">解除绑定</el-button>
						<el-button type="text" @click="boundClick1(scope.$index, scope.row)" v-else>绑定机构</el-button>
					</template>
				</el-table-column>
			</el-table>

			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="salesmanShow = false">关闭</el-button>
			</span>
		</el-dialog>

		<!-- 管理员弹框 -->
		<el-dialog title="绑定管理员" :visible.sync="managerShow" v-if="managerShow" width="60%" @close="getData">
			<div class="row-me row-center">
				<el-form :model="managerForm" label-width="160px" class="ipt row-me">
					<el-form-item label="用户ID、姓名、电话:">
						<el-input v-model="managerForm.key" placeholder="请输入用户ID、姓名、电话" @input="keyInput"></el-input>
					</el-form-item>
				</el-form>
				<div class="margin-bottom20 margin-left20">
					<el-button type="primary" @click="managerSearch">查询</el-button>
					<el-button @click="managerResetClick">重置</el-button>
				</div>
			</div>
			<el-table :data="managerList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
				<el-table-column prop="id" label="ID" align="center"></el-table-column>
				<el-table-column prop="name" label="姓名" align="center"></el-table-column>
				<el-table-column prop="mobile" label="电话" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="targetName" label="报考类型" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="subjectName" label="报考科目" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="cityName" label="报考地区" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="createTime" label="注册时间" align="center"></el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button type="text" @click="boundClick(scope.$index, scope.row)"
							v-if="$.isEmpty(scope.row.identity) || scope.row.identity == '普通用户'">绑定机构</el-button>
						<el-button type="text" @click="boundClick(scope.$index, scope.row)" v-else>解除绑定</el-button>
					</template>
				</el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="handleClose">关闭</el-button>
			</span>
		</el-dialog>

		<!-- 班次管理 -->
		<el-dialog title="班次管理" :visible.sync="classesShow" v-if="classesShow" width="60%">
			<div class="row-me row-center">
				<el-form :model="classesForm" label-width="160px" class="ipt row-me">
					<el-form-item label="用户ID、姓名、电话:">
						<el-input v-model="classesForm.key" placeholder="请输入用户ID、姓名、电话" @input="changeMessage()"></el-input>
					</el-form-item>
				</el-form>
				<div class="margin-bottom20 margin-left20">
					<el-button type="primary" @click="classesSearch">查询</el-button>
					<el-button @click="classesResetClick">重置</el-button>
					<el-button type="primary" @click="classesAddClick">新建</el-button>
				</div>
			</div>
			<el-table :data="classesList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
				<el-table-column prop="id" label="ID" align="center"></el-table-column>
				<el-table-column prop="className" label="班次名称" align="center"></el-table-column>
				<el-table-column prop="startTime" label="开始时间" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="endTime" label="截止时间" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="classPrice" label="价格" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="recruitNum" label="招生人数" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="classComment" label="介绍" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="phone" label="联系电话" align="center"></el-table-column>
				<el-table-column prop="thumbUp" label="状态" show-overflow-tooltip align="center">
					<template slot-scope="scope">
						<span class="" v-if="scope.row.classStatus == 0">未开始</span>
						<span class="" v-if="scope.row.classStatus == 1">进行中</span>
						<span class="" v-if="scope.row.classStatus == 2">已结束</span>
					</template>
				</el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button type="text" @click="classesEditClick(scope.$index, scope.row)">编辑</el-button>
						<el-popconfirm title="确定删除？" @confirm="classesDelClick(scope.row.id)">
							<el-button type="text" slot="reference">删除</el-button>
						</el-popconfirm>
					</template>
				</el-table-column>
			</el-table>

			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="classesShow = false">关闭</el-button>
			</span>
		</el-dialog>

		<!-- 新建班次 -->
		<el-dialog :title="titleClasses" :visible.sync="newShiftShow" v-if="newShiftShow" width="40%">

			<el-form :model="addClassesForm" :rules="rules" ref="addClassesForm" label-width="100px"
				class="demo-addClassesForm">
				<el-form-item label="班次名称" prop="className">
					<el-input v-model="addClassesForm.className" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="开始时间" prop="startTime">
					<el-form-item prop="startTime">
						<el-date-picker type="date" value-format="yyyy-MM-dd" placeholder="请选择" v-model="addClassesForm.startTime"
							style="width: 100%;"></el-date-picker>
					</el-form-item>
				</el-form-item>
				<el-form-item label="截止时间" prop="endTime">
					<el-form-item prop="date2">
						<el-date-picker type="date" value-format="yyyy-MM-dd" placeholder="请选择" v-model="addClassesForm.endTime"
							style="width: 100%;"></el-date-picker>
					</el-form-item>
				</el-form-item>
				<el-form-item label="价格" prop="classPrice">
					<el-input v-model="addClassesForm.classPrice" placeholder="请输入"
						onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"></el-input>
				</el-form-item>
				<el-form-item label="招生人数" prop="recruitNum">
					<el-input v-model="addClassesForm.recruitNum" placeholder="请输入"
						oninput="value=value.replace(/[^\d]/g,'')"></el-input>
				</el-form-item>
				<el-form-item label="联系电话" prop="phone">
					<el-input v-model="addClassesForm.phone" placeholder="请输入"
						oninput="value=value.replace(/[^\d]/g,'')"></el-input>
				</el-form-item>
				<el-form-item label="介绍" prop="classComment">
					<el-input type="textarea" v-model="addClassesForm.classComment" maxlength="20" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="submitForm('addClassesForm')">确定</el-button>
					<el-button @click="newShiftShow = false">取消</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>

		<!-- 每日一练设置 -->
		<el-dialog title="每日一练设置" :visible.sync="practiceShow" v-if="practiceShow" width="60%">
			<el-button type="primary" @click="OBGTClick" class="margin-bottom20">添加科目</el-button>
			<el-table :data="practiceList" border class="table" ref="multipleTable" header-cell-class-name="table-header">
				<el-table-column prop="miniName" label="科目" align="center"></el-table-column>
				<el-table-column prop="questionName" label="题型" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="count" label="数量" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column prop="createTime" label="保存日期" show-overflow-tooltip align="center"></el-table-column>
				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button type="text" @click="practiceEditClick(scope.$index, scope.row)">编辑</el-button>
						<el-popconfirm title="确定删除？" @confirm="practiceDelClick(scope.row.id)">
							<el-button type="text" slot="reference">删除</el-button>
						</el-popconfirm>
					</template>
				</el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="practiceShow = false">关闭</el-button>
			</span>
		</el-dialog>

		<!-- 每日一练添加科目 -->
		<el-dialog :title="addTit" :visible.sync="OBGTShow" v-if="OBGTShow" width="40%">

			<el-form :model="OBGTForm" :rules="rules1" ref="OBGTForm" label-width="120px" class="demo-addClassesForm">
				<el-form-item label="选择科目" prop="appid">
					<el-select v-model="OBGTForm.appid" placeholder="请选择" class="width100Per">
						<el-option :label="item.name" :value="item.id" v-for="(item,index) in appidList" :key="index"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="设置题型、数量" prop="count">
					<div class="row-me row-center margin-bottom10" v-for="(item,index) in OBGTForm.amountList" :key="index">
						<el-select v-model="item.questionType" placeholder="请选择题型" class="width100Per">
							<el-option :label="item.name" :value="item.id" v-for="(item,index) in questionList"
								:key="index"></el-option>
						</el-select>

						<el-input v-model="item.count" placeholder="请输入数量" oninput="value=value.replace(/[^\d]/g,'')"
							@input="numChange"></el-input>
						<div style="width:210px" class="row-me row-center">
							<div class=" margin-left10" style="color:#66b1ff;cursor: pointer;"
								v-if="OBGTForm.amountList.length==Number(index+1) && addTit == '添加科目'" @click="addNum()">增加</div>
							<div class="margin-left10" style="color:#66b1ff;cursor: pointer;" v-if="OBGTForm.amountList.length>1"
								@click="delNum(index,item.count)">删除</div>
						</div>
					</div>
				</el-form-item>

				<el-form-item label="题目总数">
					<el-input v-model="OBGTForm.allNum" :disabled="true" placeholder="请输入"></el-input>
				</el-form-item>

				<el-form-item label="显示天数">
					<el-input v-model=" OBGTForm.showDay" placeholder="请输入"></el-input>
				</el-form-item>

				<el-form-item>
					<el-button type="primary" @click="OBGTConfirm('OBGTForm')">确定</el-button>
					<el-button @click="OBGTShow = false">取消</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>

		<!-- 高德地图 -->
		<el-dialog title="位置信息" :visible.sync="trainShow" v-if="trainShow" width="40%">
			<div>
				<div class=" margin-bottom20">
					<el-input id="medicalAddress" name="medicalAddress" type="text" class="form-control" v-model="medicalAddress"
						placeholder="搜索并选择位置"></el-input>
				</div>
				<div id="map" style="width: 100%; height: 600px"></div>
			</div>
			<el-button type="primary" class="margin-top20" @click="mapSure()">确定</el-button>
		</el-dialog>

		<!-- 批量修改业务员 -->
		<el-dialog title="批量修改业务员" :visible.sync="clerkShow" v-if="clerkShow" width="40%">
			<el-form :model="clerkForm" :rules="rules3" ref="clerkForm" label-width="120px" class="demo-addClassesForm">
				<el-form-item label="业务员" prop="salesman">
					<el-select v-model="clerkForm.salesman" placeholder="请选择业务员" class="width100Per">
						<el-option v-for="(item,index) in salesmanList" :key="index" :value="item.id" :label="item.name">
						</el-option>
					</el-select>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="clerkConfirm('clerkForm')">确定</el-button>
					<!-- <el-button @click="OBGTShow = false">取消</el-button> -->
				</el-form-item>
			</el-form>
		</el-dialog>

		<!-- 888888888888888888888 -->
		<imgLibrary ref="publicityImg1" @handleImgOk="handleImgOk"></imgLibrary>
		<imgLibrary ref="organImg" @handleImgOk="handleImgOk1"></imgLibrary>
		<imgLibrary ref="schoolVideo1" @handleImgOk="handleImgOk2"></imgLibrary>
		<imgLibrary ref="imgLibrary" @handleImgOk="handleImgCommentOk"></imgLibrary>

	</div>
</template>

<script>
	import QRCode from 'qrcodejs2';

	import uploadLocal from "@/components/Upload/multiUploadLocal"
	import singleUploadLocal from "@/components/Upload/singleUploadLocal"
	import imgLibrary from "@/components/imgLibrary"

	export default {
		name: 'categoryTable',
		components: {
			uploadLocal,
			singleUploadLocal,
			imgLibrary
		},
		data() {
			let that = this
			return {
				query: {
					name: '',
					type: '',
					pageNumber: 1,
					pageSize: 30
				},
				dialogTitle: '',
				tableData: [],
				multipleSelection: [],
				delList: [],
				// 新建商家
				shopsShow: false,
				shopsForm: {
					publicityImg1: [], //宣传图片
					publicityImg: [], //宣传图片
					isComment: '0', //是否显示评价
					schoolVideo1: [], //学校风采
					schoolVideo: [], //学校风采
				},
				isDisabled: false,
				labelList: [], //标签管理
				areaList: [], //所属区域
				srcList: [],
				uploadUrl: this.$host + '/file/upload?token=' + localStorage.getItem('token'),
				fileList: [],
				shopsIndexList: [1, 4, 5],
				activeName: 'one',
				// 标签-热门、推荐、精选
				tagList: [{
						id: 1,
						name: '热门'
					},
					{
						id: 2,
						name: '推荐'
					},
					{
						id: 3,
						name: '精选'
					},
				],
				// 认证类型-1笔试2面试3笔试+面试
				auTypeList: [{
						id: 1,
						name: '笔试'
					},
					{
						id: 2,
						name: '面试'
					},
					{
						id: 3,
						name: '笔试+面试'
					},
				],


				pageTotal: 0,
				form: {},
				salesmanList: [], //业务员
				salesmanRow: {},
				dateList: [],
				qrcodeVisible: false,
				reviewsShow: false,
				reviewsList: [], //学员评价列表
				salesmanShow: false, //业务员
				salesmanForm: {
					key: ''
				},
				managerShow: false, //管理员
				managerForm: {
					pageNumber: 1,
					pageSize: 10000,
				},
				managerList: [],
				classesShow: false, //班次管理
				classesForm: {
					pageNumber: 1,
					pageSize: 10000,
				},
				classesList: [],
				practiceDailyId: '', //每日一练id
				// 新建班次
				newShiftShow: false,
				titleClasses: '新建班次',
				addClassesForm: {},
				rules: {
					className: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
					startTime: [{
						required: true,
						message: '请选择',
						trigger: 'change'
					}],
					startTime: [{
						required: true,
						message: '请选择',
						trigger: 'change'
					}],
					endTime: [{
						required: true,
						message: '请选择',
						trigger: 'change'
					}],
					classPrice: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
					recruitNum: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
					phone: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
					classComment: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
				},
				practiceShow: false, //每日一练
				practiceList: [],
				OBGTShow: false,
				addTit: '添加科目',
				appidList: [],
				questionList: [],
				OBGTForm: {
					amountList: [{
						questionType: '',
						count: '',
					}],
					allNum: 0,
				},
				rules1: {
					name: [{
						required: true,
						message: '请选择',
						trigger: 'change'
					}],
					fate: [{
						required: true,
						message: '请输入',
					}],
				},

				// -------
				// 地图
				trainShow: false,
				medicalAddress: '',
				lonLat: [116.397428, 39.90923], // 经纬度-编辑回显定位-北京
				map: null,
				clerkShow: false,
				clerkForm: {},
				rules3: {
					salesman: [{
						required: true,
						message: '请选择',
						trigger: 'change'
					}],
				},
				rowId: '',
				businessId: '',
				editorConfig: {
					serverUrl: process.env.BASE_API + "/file/upload",
					UEDITOR_HOME_URL: '/static/UEditor/',
					toolbarCallback: function(cmd, editor) {
						switch (cmd) {
							case 'insertimage':
								that.$refs.imgLibrary.show()
								return true;
						}
					}
				},
				organId: ''
			};
		},
		created() {
			this.getData();
			this.getProvinceWay();
			this.organBusinBindingListWay(); //业务员
			// this.labelListWay(); //标签管理
			this.teacherAllWay(); //讲师科目列表
			this.getTypeWay(); //题型


		},
		methods: {
			organChange(val, type) {
				if (type == 1) {
					this.shopsForm.hintWrit1 = true
				} else if (type == 2) {
					this.shopsForm.hintInter1 = true
				}
				this.$forceUpdate()
			},
			dateChange(val) {
				this.$forceUpdate()
			},
			handleClose() {
				this.managerShow = false;
				this.getData()
			},
			clickCommentImg() {
				this.$refs.imgLibrary.show()
			},
			handleImgCommentOk(data) {
				this.shopsForm.showComment = this.shopsForm.showComment + `<img src='${data}'>`
			},
			numChange(e) {
				console.log(e, this.OBGTForm.amountList, 'eee');
				if (this.addTit == '添加科目') {
					let arr = Array.from(this.OBGTForm.amountList, ({
						count
					}) => {
						if (!this.$.isEmpty(count)) {
							return count
						}
					})
					arr = arr.filter(item => item)
					this.OBGTForm.allNum = eval(arr.join("+"));
				} else {
					this.OBGTForm.allNum = Number(e);
				}
			},
			//获取宣传图片
			handleImgOk(data) {
				console.log(data, 'datadata')
				// this.$set(this.shopsForm, 'publicityImg', data)
				if (Array.isArray(this.shopsForm.publicityImg1)) {
					this.shopsForm.publicityImg1.push(data);
				} else {
					this.shopsForm.publicityImg1 = [data]
				}
				this.$forceUpdate(); //强制刷新
			},
			//点击图片库
			clickImg() {
				this.$refs.publicityImg1.show()
			},
			//获取机构封面图
			handleImgOk1(data) {
				this.$set(this.shopsForm, 'organImg', data)
				this.$forceUpdate(); //强制刷新
			},
			//点击图片库
			clickImg1() {
				this.$refs.organImg.show()
			},
			//获取学校风采
			handleImgOk2(data) {
				if (Array.isArray(this.shopsForm.schoolVideo1)) {
					this.shopsForm.schoolVideo1.push(data);
				} else {
					this.shopsForm.schoolVideo1 = [data]
				}
				this.$forceUpdate(); //强制刷新
				// this.$set(this.shopsForm, 'schoolVideo', data)
			},
			//点击图片库
			clickImg2() {
				this.$refs.schoolVideo1.show()
			},

			// 点击基础信息的下一步-777777777777777
			oneClick() {

				// 机构名字===organName      公司名称===companyName     
				// 宣传图片===publicityImg     机构封面图===organImg     
				// 培训年限===trainYear    企业联系电话===companyPhone    培训地址===trainAddress       
				// 认证类型===authType       所属区域===area       
				// 地址说明===addressComment      是否显示评价===isComment
				if (this.$.isEmpty(this.shopsForm.organName)) {
					this.$message.error('机构名字不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.companyName)) {
					this.$message.error('公司名称不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.publicityImg1)) {
					this.$message.error('宣传图片不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.organImg)) {
					this.$message.error('机构封面图不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.trainYear)) {
					this.$message.error('培训年限不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.companyPhone)) {
					this.$message.error('业联系电话不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.trainAddress)) {
					this.$message.error('培训地址不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.authType)) {
					this.$message.error('认证类型不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.area)) {
					this.$message.error('所属区域不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.addressComment)) {
					this.$message.error('地址说明不能为空!');
					return
				}
				if (this.$.isEmpty(this.shopsForm.isComment)) {
					this.$message.error('是否显示评价不能为空!');
					return
				}

				this.shopsForm.province = this.shopsForm.area[0];
				this.shopsForm.city = this.shopsForm.area[1];
				this.shopsForm.region = this.shopsForm.area[2];


				// 需要判断-tab 参数值
				if (this.shopsForm.authType == 1) {
					// 笔试
					this.activeName = 'two';
					if (this.$.isEmpty(this.shopsForm.organWrit)) {
						this.shopsForm.organWrit = 1;
					}
				} else if (this.shopsForm.authType == 2) {
					// 面试
					this.activeName = 'three';

					if (this.$.isEmpty(this.shopsForm.organInter)) {
						this.shopsForm.organInter = 1; //面试
					}
				} else if (this.shopsForm.authType == 3) {
					// 笔试
					this.activeName = 'two';
					if (this.$.isEmpty(this.shopsForm.organWrit)) {
						this.shopsForm.organWrit = 1;
					}
				}
				// return
			},
			// 点击笔试上一步
			twoClickS() {
				this.activeName = 'one';
			},
			// 点击笔试下一步
			twoClickX() {
				if (this.shopsForm.organWrit != 0) {
					if (this.$.isEmpty(this.shopsForm.writPrice)) {
						this.$message.error('请输入会员价格!');
						return
					}
					if (this.$.isEmpty(this.shopsForm.writTime)) {
						this.$message.error('请选择到期时间!');
						return
					}
				}
				if (this.shopsForm.authType == 1) {
					this.activeName = 'four';
				} else if (this.shopsForm.authType == 3) {
					this.activeName = 'three';
					if (this.$.isEmpty(this.shopsForm.organInter)) {
						this.shopsForm.organInter = 1; //面试
					}
				}
			},
			// 点击面试上一步
			threeClickS() {
				if (this.shopsForm.authType == 2) {
					this.activeName = 'one';
				} else if (this.shopsForm.authType == 3) {
					this.activeName = 'two';
					if (this.$.isEmpty(this.shopsForm.organWrit)) {
						this.shopsForm.organWrit = 1;
					}
				}
			},
			// 点击面试下一步
			threeClickX() {
				if (this.shopsForm.organInter != 0) {
					if (this.$.isEmpty(this.shopsForm.interPrice)) {
						this.$message.error('请输入会员价格!');
						return
					}
					if (this.$.isEmpty(this.shopsForm.interTime)) {
						this.$message.error('请选择到期时间!');
						return
					}
				}
				this.activeName = 'four';
			},
			// 点击其他设置上一步
			fourClickS() {
				// 需要判断-tab 参数值
				if (this.shopsForm.authType == 1) {
					this.activeName = 'two';
					if (this.$.isEmpty(this.shopsForm.organWrit)) {
						this.shopsForm.organWrit = 1; //笔试
					}
				} else if (this.shopsForm.authType == 2) {
					this.activeName = 'three';
					if (this.$.isEmpty(this.shopsForm.organInter)) {
						this.shopsForm.organInter = 1; //面试
					}
				} else if (this.shopsForm.authType == 3) {
					this.activeName = 'three';
					if (this.$.isEmpty(this.shopsForm.organInter)) {
						this.shopsForm.organInter = 1; //面试
					}
				}
			},
			// 点击其他设置下一步
			fourClickX() {
				if (this.$.isEmpty(this.shopsForm.businessId)) {
					this.$message.error('业务员不能为空!');
					return
				}
				this.activeName = 'five';
			},
			// 点击详情上一步
			fiveClickS() {
				this.activeName = 'four';
			},
			// 点击详情下一步
			fiveSubmit() {
				if (this.$.isEmpty(this.shopsForm.showComment)) {
					this.$message.error('详情不能为空!');
					return
				}

				this.shopsForm.publicityImg = this.shopsForm.publicityImg1 ? this.shopsForm.publicityImg1.join(",") : '';
				this.shopsForm.schoolVideo = this.shopsForm.schoolVideo1 ? this.shopsForm.schoolVideo1.join(",") : '';

				this.shopsForm.writLabel = this.shopsForm.writLabel ? this.shopsForm.writLabel.toString() : ''
				if (!this.$.isEmpty(this.shopsForm.interLabel1) && this.shopsForm.interLabel1.length > 0) {
					this.shopsForm.interLabel = this.shopsForm.interLabel1.join(",");
				}
				// 是否显示班次
				if (!this.$.isEmpty(this.shopsForm.writClass1)) {
					// 0否1是
					if (this.shopsForm.writClass1 == true) {
						this.shopsForm.writClass = 1;
					} else {
						this.shopsForm.writClass = 0;
					}
				}
				if (!this.$.isEmpty(this.shopsForm.interClass1)) {
					// 0否1是
					if (this.shopsForm.interClass1 == true) {
						this.shopsForm.interClass = 1;
					} else {
						this.shopsForm.interClass = 0;
					}
				}
				// 笔试
				// popWrit    未认证弹窗提醒        authenWrit 显示未认证图标       hintWrit   提醒设置         
				if (!this.$.isEmpty(this.shopsForm.popWrit1)) {
					// 0否1是
					if (this.shopsForm.popWrit1 == true) {
						this.shopsForm.popWrit = 1;
					} else {
						this.shopsForm.popWrit = 0;
					}
				}
				if (!this.$.isEmpty(this.shopsForm.authenWrit1)) {
					// 0否1是
					if (this.shopsForm.authenWrit1 == true) {
						this.shopsForm.authenWrit = 1;
					} else {
						this.shopsForm.authenWrit = 0;
					}
				}
				this.shopsForm.hintWrit = this.shopsForm.hintWrit ? 1 : 0
				this.shopsForm.hintInter = this.shopsForm.hintInter ? 1 : 0
				// 未认证弹窗提醒   popInter       authenInter    显示未认证图标   提醒设置     hintInter
				if (!this.$.isEmpty(this.shopsForm.popInter1)) {
					// 0否1是
					if (this.shopsForm.popInter1 == true) {
						this.shopsForm.popInter = 1;
					} else {
						this.shopsForm.popInter = 0;
					}
				}
				if (!this.$.isEmpty(this.shopsForm.authenInter1)) {
					// 0否1是
					if (this.shopsForm.authenInter1 == true) {
						this.shopsForm.authenInter = 1;
					} else {
						this.shopsForm.authenInter = 0;
					}
				}

				var url;
				if (!this.$.isEmpty(this.shopsForm.id)) {
					url = '/admin/messages/organShowUpdate';
				} else {
					url = '/admin/messages/organAdd';
				}
				this.$post(url, this.shopsForm).then((res) => {
					if (res.code == 1000) {
						this.$message.success('操作成功');
						this.getData();
						this.shopsShow = false;
						this.$forceUpdate(); //强制刷新
					}
				}).catch((error) => {
					console.log(error)
				})

			},


			// 点击批量修改业务员
			clerkConfirm(clerkForm) {
				this.$refs[clerkForm].validate((valid) => {
					if (valid) {
						var ids = [];
						var list = [];

						this.multipleSelection.forEach((item, index) => {
							ids.push(item.id);
						});

						this.$postForm('/admin/messages/organBusinBindingAll', {
							businessId: this.clerkForm.salesman,
							ids: ids.join(','),
						}).then((res) => {
							if (res.code == 1000) {
								this.$message.success('操作成功');
								this.multipleSelection = [];
								this.getData();
								this.clerkShow = false;
							}
						}).catch((error) => {
							console.log(error)
						})


					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			// 递归移除第4层children
			getTreeData(data) {
				// 循环遍历json数据
				for (var i = 0; i < data.length; i++) {
					if (data[i].level == 3) { //等于3的时候把第4层children-设为-undefined
						// children若为空数组，则将children设为undefined
						data[i].children = undefined;
					} else {
						// children若不为空数组，则继续 递归调用 本方法
						this.getTreeData(data[i].children);
					}
				}
				return data;
			},
			// 获取省市区
			getProvinceWay() {
				this.$get('/admin/area/getAllArea', {}).then((res) => {
					if (res.code == 1000) {
						this.areaList = this.getTreeData(res.data); //获取树结构值
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 获取业务员
			organBusinBindingListWay() {
				this.$postForm('/admin/messages/organBusinBindingList', {
					pageNumber: 1,
					pageSize: 10000,
				}).then((res) => {
					if (res.code == 1000) {
						this.salesmanList = res.data.list;
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			labelListWay() {
				this.$postForm('/admin/label/labelList', {}).then((res) => {
					if (res.code == 1000) {
						this.labelList = res.data.list;
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			teacherAllWay() {
				this.$get('/admin/minis/getAll', {}).then((res) => {
					if (res.code == 1000) {
						this.appidList = res.data;
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			getTypeWay() {
				this.$get('/admin/questionType/getQuestionSort', {}).then((res) => {
					if (res.code == 1000) {
						this.questionList = res.data;
					}
				}).catch((error) => {
					console.log(error)
				})
			},




			// 新建商家开始
			// 66666666666666666
			// 点击确定获取地图信息
			mapSure() {
				this.trainShow = false;
			},
			initMap() {
				/* eslint-disable */
				/* eslint-disable no-alert, no-console */
				let that = this;
				that.map = new AMap.Map('map', {
					resizeEnable: true, //是否监控地图容器尺寸变化
					zoom: 15, //初始化地图层级
					center: [116.397428, 39.90923] //初始化地图中心点-北京
					// center: [120.343414, 36.102402], //初始化地图中心点
					// center: that.lonLat, //初始化地图中心点-打开默认北京。否当前定位
				});

				//输入提示
				var autoOptions = {
					input: "medicalAddress"
				};

				that.map.plugin(['AMap.PlaceSearch', 'AMap.Autocomplete', 'AMap.ToolBar', 'AMap.Scale',
						'AMap.CircleEditor'
					],
					function() {

						const toolbar = new AMap.ToolBar() // 工具条
						const scale = new AMap.Scale() // 比例尺
						that.map.addControl(toolbar)
						that.map.addControl(scale)

						var auto = new AMap.Autocomplete(autoOptions);
						console.log(auto, "auto")
						var placeSearch = new AMap.PlaceSearch({
							// 构造地点查询类
							map: that.map, // 展现结果的地图实例
							citylimit: true, // 是否强制限制在设置的城市内搜索
							autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
						}); //构造地点查询类
						auto.on("select", select); //注册监听，当选中某条记录时会触发
						function select(e) {
							console.log(e, '回车返回信息1035')
							placeSearch.setCity(e.poi.adcode);
							placeSearch.search(e.poi.name); //关键字查询查询;

							that.shopsForm.trainAddress = e.poi.district + e.poi.name;
							if (!that.$.isEmpty(e.poi.location)) {
								that.shopsForm.lat = e.poi.location.lat;
								that.shopsForm.lon = e.poi.location.lng;
							}
						}
					});
			},
			trainClick() {
				this.trainShow = true;
				// 如果在el-dialog弹窗里面--点击显示弹窗的时候延时载入地图
				// 生成地图
				var _self = this;
				setTimeout(function() {
					_self.initMap();
				}, 500)
			},
			// 上传营业执照
			charterUpload(file) {
				const isLt2M = file.size / 1024 / 1024 < 10;
				// let isImage = ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'];
				let isImage = ['image/png'];
				const isJPG = isImage.includes(file.type);
				if (!isJPG) {
					this.$message.error('上传图片只支持PNG!')
					return false
				}
				if (!isLt2M) {
					this.$message.error('上传图片大小不能超过 1G!');
				}
				return isJPG && isLt2M;
			},
			// 上传图片
			charterFile(param) {
				const file = param.file
				const formData = new FormData()
				formData.append('file', file)
				this.$uploadFile('/file/upload', formData).then((res) => {
					if (res.code == 1000) {
						this.$nextTick(() => {
							this.shopsForm.companyImg = res.data
							this.$forceUpdate()
						})
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			delCharter() {
				this.$nextTick(() => {
					this.shopsForm.img = '';
					this.$forceUpdate()
				})
			},

			// 宣传图片
			publicityUpload(file) {
				console.log(file, 'file--------')
				const isLt5M = file.size / 1024 / 1024 < 5;
				let isImage = ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'];
				const isJPG = isImage.includes(file.type);
				if (!isJPG) {
					this.$message.error('上传图片只支持PNG,JPG!')
					return false
				}
				if (!isLt5M) {
					this.$message.error('上传图片大小不能超过 5MB!');
				}
				return isJPG && isLt5M;
			},
			// 上传图片
			publicityFile(param) {
				const file = param.file
				const formData = new FormData()
				formData.append('file', file)
				this.$uploadFile('/file/upload', formData).then((res) => {
					if (res.code == 1000) {
						this.$nextTick(() => {
							this.shopsForm.publicityImg1.push(res.data)
							this.$forceUpdate()
						})
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 点击删除宣传图片
			delPublicity(index) {
				this.shopsForm.publicityImg1.splice(index, 1);
				this.$forceUpdate()
			},
			delPublicity2(index) {
				this.shopsForm.schoolVideo1.splice(index, 1);
				this.$forceUpdate()
			},
			// 宣传视频
			videoUpload(file) {
				console.log(file, '-------')
				const isLt10M = file.size / 1024 / 1024 < 1000;
				// let isImage = ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'];
				let isImage = ['video/mp4'];
				const isJPG = isImage.includes(file.type);
				if (!isJPG) {
					this.$message.error('上传视频只支持mp4!')
					return false
				}
				if (!isLt10M) {
					this.$message.error('上传视频大小不能超过 1G!');
				}
				return isJPG && isLt10M;
			},
			// 上传视频
			videoFile(param) {
				const file = param.file
				const formData = new FormData()
				formData.append('file', file)
				this.$uploadFile('/file/upload', formData).then((res) => {
					if (res.code == 1000) {
						this.$nextTick(() => {
							this.shopsForm.publicityVideo = res.data
							this.$forceUpdate()
						})
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			delvideo() {
				this.$nextTick(() => {
					this.shopsForm.publicityVideo = '';
					this.$forceUpdate()
				})
			},

			// 机构封面图
			twitterUpload(file) {
				const isLt1G = file.size / 1024 / 1024 < 10;
				let isImage = ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'];
				const isJPG = isImage.includes(file.type);
				if (!isJPG) {
					this.$message.error('上传图片只支持PNG，JPG!')
					return false
				}
				if (!isLt1G) {
					this.$message.error('上传图片大小不能超过 1G!');
				}
				return isJPG && isLt1G;
			},
			// 上传图片
			twitterFile(param) {
				const file = param.file
				const formData = new FormData()
				formData.append('file', file)
				this.$uploadFile('/file/upload', formData).then((res) => {
					if (res.code == 1000) {
						this.$nextTick(() => {
							this.shopsForm.organImg = res.data
							this.$forceUpdate()
						})
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			delTwitter() {
				this.$nextTick(() => {
					this.shopsForm.organImg = '';
					this.$forceUpdate()
				})
			},
			// 点击选择笔试面试
			auTypeChange() {
				if (this.shopsForm.authType == 1) {
					this.shopsIndexList = [1, 2, 4, 5]
				}
				if (this.shopsForm.authType == 2) {
					this.shopsIndexList = [1, 3, 4, 5]
				}
				if (this.shopsForm.authType == 3) {
					this.shopsIndexList = [1, 2, 3, 4, 5]
				}
				if (this.$.isEmpty(this.shopsForm.authType)) {
					this.shopsIndexList = [1, 4, 5]
				}
				this.$forceUpdate()
			},

			// 学校风采
			// 宣传图片
			mienUpload(file) {
				console.log(file, 'file--------')
				const isLt5M = file.size / 1024 / 1024 < 5;
				let isImage = ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'];
				const isJPG = isImage.includes(file.type);
				if (!isJPG) {
					this.$message.error('上传图片只支持PNG,JPG!')
					return false
				}
				if (!isLt5M) {
					this.$message.error('上传图片大小不能超过 5MB!');
				}
				return isJPG && isLt5M;
			},
			// 上传图片
			mienFile(param) {
				const file = param.file
				const formData = new FormData()
				formData.append('file', file)
				this.$uploadFile('/file/upload', formData).then((res) => {
					if (res.code == 1000) {
						this.$nextTick(() => {
							this.shopsForm.schoolVideo.push(res.data)
							this.$forceUpdate()
						})
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 点击删除宣传图片
			delMien(index) {
				this.shopsForm.schoolVideo1.splice(index, 1);
			},
			// 监听输入几星
			handlerChange(e) {
				console.log(e, 'eeeeeee');
				// this.shopsForm.scoreNum1 = 1
				if (e < 0.5 && e < 1) {
					this.shopsForm.scoreNum1 = 0.5;
				} else if (e == 1) {
					this.shopsForm.scoreNum1 = 1;
				} else if (e > 1 && e < 2) {
					this.shopsForm.scoreNum1 = 1.5;
				} else if (e == 2) {
					this.shopsForm.scoreNum1 = 2;
				} else if (e > 2 && e < 3) {
					this.shopsForm.scoreNum1 = 2.5;
				} else if (e == 3) {
					this.shopsForm.scoreNum1 = 3;
				} else if (e > 3 && e < 4) {
					this.shopsForm.scoreNum1 = 3.5;
				} else if (e == 4) {
					this.shopsForm.scoreNum1 = 4;
				} else if (e > 4 && e < 5) {
					this.shopsForm.scoreNum1 = 4.5;
				} else if (e >= 5) {
					this.shopsForm.scoreNum1 = 5;
					this.shopsForm.score = 5;
				}
			},
			// 点击选择到期时间
			dueTimeClick(val) {
				this.shopsForm.startTime = val[0]
				this.shopsForm.endTime = val[1]
			},
			// 新建商家结束------------

			// 每日一练设置
			// 编辑每日一练
			practiceEditClick(index, row) {
				this.OBGTForm = {
					appid: row.appid,
					showDay: row.showDay,
					amountList: [{
						questionType: row.questionType,
						count: row.count,
					}],
					allNum: row.count,
					id: row.id
				};

				this.addTit = '编辑科目';
				this.OBGTShow = true;
			},
			// 删除每日一练
			practiceDelClick(id) {
				this.$postForm("/admin/messages/RandConfigDelete", {
					id: id
				}).then((res) => {
					if (res.code == 1000) {
						this.practiceDaily(this.practiceDailyId);
						this.$message.success('操作成功');
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 新增每日一练
			OBGTClick() {
				this.OBGTForm = {
					amountList: [{
						questionType: '',
						count: '',
					}],
					allNum: 0,
				};

				this.addTit = '添加科目';
				this.OBGTShow = true;
			},
			// 新增每日一练确定3333333333333333
			OBGTConfirm(OBGTForm) {
				this.$refs[OBGTForm].validate((valid) => {
					if (valid) {
						if (this.addTit == '编辑科目') {
							if (this.$.isEmpty(this.OBGTForm.appid)) {
								this.$message.error('请选择选择科目！');
								return
							}

							if (this.OBGTForm.allNum == 0) {
								this.$message.error('请设置设置题型、数量！');
								return
							}

							if (this.$.isEmpty(this.OBGTForm.showDay)) {
								this.$message.error('显示天数不能为空！');
								return
							}


							var list = [{
								appid: this.OBGTForm.appid,
								showDay: this.OBGTForm.showDay,
								organId: this.practiceDailyId,
								questionType: this.OBGTForm.amountList[0].questionType,
								count: this.OBGTForm.amountList[0].count,
								id: this.OBGTForm.id
							}];
							this.$post("/admin/messages/RandConfigUpdate", list).then((res) => {
								if (res.code == 1000) {
									this.practiceDaily(this.practiceDailyId);
									this.$message.success('操作成功');
									this.OBGTShow = false;
									this.OBGTForm = {
										amountList: [{
											questionType: '',
											count: '',
										}],
										allNum: 0,
									};
								}
							}).catch((error) => {
								console.log(error)
							})
						} else {
							if (this.$.isEmpty(this.OBGTForm.appid)) {
								this.$message.error('请选择选择科目！');
								return
							}
							if (this.OBGTForm.allNum == 0) {
								this.$message.error('请设置设置题型、数量！');
								return
							}

							if (this.$.isEmpty(this.OBGTForm.showDay)) {
								this.$message.error('显示天数不能为空！');
								return
							}

							this.OBGTForm.amountList.forEach((item, index) => {
								item.appid = this.OBGTForm.appid;
								item.showDay = this.OBGTForm.showDay;
								item.organId = this.practiceDailyId;
							});
							this.$post("/admin/messages/RandConfigAdd", this.OBGTForm.amountList).then((res) => {
								if (res.code == 1000) {
									this.practiceDaily(this.practiceDailyId);
									this.$message.success('操作成功');
									this.OBGTShow = false;
									this.OBGTForm = {
										amountList: [{
											questionType: '',
											count: '',
										}],
										allNum: 0,
									};
								}
							}).catch((error) => {
								console.log(error)
							})
						}




						// 
						// this.OBGTShow = false;
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			// 点击新增题量
			addNum() {
				var obj = {
					types: '',
					num: '',
				}
				this.OBGTForm.amountList.push(obj);
			},
			// 点击删除题量
			delNum(index, num) {
				this.OBGTForm.amountList.splice(index, 1);
				this.OBGTForm.allNum = Number(this.OBGTForm.allNum) - Number(num);
			},
			// 班次管理
			// 新建班次
			submitForm(addClassesForm) {
				this.$refs[addClassesForm].validate((valid) => {
					if (valid) {
						var url;
						if (this.$.isEmpty(this.addClassesForm.id)) {
							this.addClassesForm.organId = this.organId
							url = '/admin/messages/classAdd';
						} else {
							url = '/admin/messages/classUpdate';
						}

						this.$post(url, this.addClassesForm).then((res) => {
							if (res.code == 1000) {
								this.classAllWay();
								this.$message.success('操作成功');
								this.newShiftShow = false;
								this.addClassesForm = {};
							}
						}).catch((error) => {
							console.log(error)
						})
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			resetForm(addClassesForm) {
				this.$refs[addClassesForm].resetFields();
			},
			// 点击搜索班次
			classesSearch() {
				this.classAllWay()
			},
			// 点击重置班次
			classesResetClick() {
				this.classesForm.key = '';
				this.classesForm.pageNumber = 1;
				this.classesForm.pageSize = 10000;
				this.classAllWay()
			},
			// 点击新建班次
			classesAddClick() {
				this.addClassesForm = {};
				this.titleClasses = '新建班次';
				this.newShiftShow = true;
			},
			// 编辑班次
			classesEditClick(index, row) {
				this.addClassesForm = {};
				this.addClassesForm = row;
				this.titleClasses = '编辑班次';
				this.newShiftShow = true;
			},
			// 删除班次
			classesDelClick(id) {
				// var list = [id];
				// this.$postForm('/admin/messages/classDeleteAll', {
				// 	ids: list
				// }).then((res) => {
				// 	if (res.code == 1000) {
				// 		this.classAllWay();
				// 		this.$message.success('删除成功');
				// 	}
				// }).catch((error) => {
				// 	console.log(error)
				// })
				var list = [];
				list.push(id)
				this.$post('/admin/messages/classDeleteAll', list).then((res) => {
					if (res.code == 1000) {
						this.classAllWay();
						this.$message.success('删除成功');
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			//查看评价
			lookReviews(index, row) {
				this.reviewsList = row.comments;
				console.log(this.reviewsList, '学员评价')
				this.reviewsShow = true
			},
			//业务员 
			revampSalesman(index, row) {
				console.log(row, '44444444444----------')
				this.salesmanRow = JSON.parse(JSON.stringify(row));

				if (!this.$.isEmpty(row.businessId)) {
					this.businessId = row.businessId; //业务员id
				} else {
					this.businessId = '';
				}
				this.rowId = row.id; //机构id

				this.$postForm('/admin/messages/organBusinBindingList', {
					businessId: this.businessId,
					pageNumber: 1,
					pageSize: 10000,
					key: this.salesmanForm.key
				}).then((res) => {
					if (res.code == 1000) {
						this.salesmanList = res.data.list;
						this.salesmanShow = true;
						this.$forceUpdate(); //强制刷新
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			boundClick1(index, row) {
				var txt;
				var url;
				var obj = {};

				if (this.$.isEmpty(row.organStatus) || row.organStatus == false) {
					txt = '是否绑定机构';
					url = '/admin/messages/organBusinBinding';
				} else {
					txt = '是否接解除绑定机构';
					url = '/admin/messages/organBusinBindingEnd';
				}
				this.$confirm(txt, "提示", {
						confirmButtonText: "确认", //确认按钮文字更换
						cancelButtonText: "取消", //取消按钮文字更换
						showClose: true, //是否显示右上角关闭按钮
						type: "warning", //提示类型  success/info/warning/error
					}).then(async () => {

						obj = {
							businessId: row.id, //业务员id
							id: this.rowId, //机构id
						}

						this.$postForm(url, obj).then((res) => {
							if (res.code == 1000) {
								this.getData();
								// this.organBusinBindingListWay();
								// this.salesmanList = [];
								this.salesmanRow.businessId = row.id;


								this.revampSalesman(1, this.salesmanRow);
								this.$forceUpdate(); //强制刷新

								this.$message.success('操作成功');
							}
						}).catch((error) => {
							console.log(error)
						})
						//确认操作
					}).then((data) => {
						//取消操作
					})
					.catch(function(err) {
						//捕获异常
					});
			},
			// 点击绑定-管理员
			boundClick(index, row) {
				var txt;
				var url;
				console.log(row, "row")
				if (row.identity == '普通用户') {
					txt = '是否绑定机构';
					url = '/admin/messages/organBinding';
				} else {
					txt = '是否接解除绑定机构';
					url = '/admin/messages/organBindingEnd';
				}
				this.$confirm(txt, "提示", {
						confirmButtonText: "确认", //确认按钮文字更换
						cancelButtonText: "取消", //取消按钮文字更换
						showClose: true, //是否显示右上角关闭按钮
						type: "warning", //提示类型  success/info/warning/error
					}).then(async () => {
						var obj = {};
						obj = {
							id: this.managerForm.organId,
							userId: row.id,
						}

						this.$postForm(url, obj).then((res) => {
							if (res.code == 1000) {
								this.managerForm.userId = row.id;
								this.organBindingListWay();
								this.$message.success('操作成功');
							}
						}).catch((error) => {
							console.log(error)
						})
						//确认操作
					}).then((data) => {
						//取消操作
					})
					.catch(function(err) {
						//捕获异常
					});
			},
			// 点击查询业务员
			salesmanSearch() {
				// this.salesmanForm.key = '';
				this.revampSalesman(1, this.salesmanRow);
			},
			// 点击重置业务员
			salesmanResetClick() {
				this.salesmanForm = {};
				this.salesmanForm.key = ''
				this.revampSalesman(1, this.salesmanRow);
			},
			// 商家二维码
			handleAppExamQrcode(index, row) {
				this.qrcodeVisible = true;

				var vm = this;
				this.appExamQrcodeVisible = true;
				setTimeout(function() {
					vm.$refs.appExamQrCodeUrl.innerHTML = '';
					vm.$refs.appExamQrCodeUrl.name = row.id + "-" + row.name;
					var qrcode = new QRCode('code', {
						text: 'https://admin.shuatibang.com/h5/login.html?{"id":"' + row.id +
							'","type":"organ"}', // 需要转换为二维码的内容
						// text: 'https://zjbdapi.zhongshi.cn/h5/login.html?id=' + row.id + '&"type"="organ"', // 需要转换为二维码的内容
						width: 150,
						height: 150,
						colorDark: '#000000',
						colorLight: '#ffffff',
						correctLevel: QRCode.CorrectLevel.H
					});
				}, 200);
			},
			// 点击下载图片
			handleDownloadAppExamQrIMg(id) {
				// 这里是获取到的图片base64编码
				var name = this.$refs.appExamQrCodeUrl.name;
				var img = document.getElementById(id).getElementsByTagName('img')[0];
				const imgUrl = img.src;
				// 如果浏览器支持msSaveOrOpenBlob方法（也就是使用IE浏览器的时候），那么调用该方法去下载图片
				if (window.navigator.msSaveOrOpenBlob) {
					let bstr = atob(imgUrl.split(',')[1]);
					let n = bstr.length;
					let u8arr = new Uint8Array(n);
					while (n--) {
						u8arr[n] = bstr.charCodeAt(n);
					}
					let blob = new Blob([u8arr]);
					window.navigator.msSaveOrOpenBlob(blob, name + '.' + 'png');
				} else {
					// 这里就按照chrome等新版浏览器来处理
					let a = document.createElement('a');
					a.href = imgUrl;
					a.setAttribute('download', name + '.' + 'png');
					a.click();
				}
			},
			// 选择省区
			handleChange(value) {
				console.log(value);
				this.query.citySheng = this.query.area[0];
				this.query.cityShi = this.query.area[1];
				this.query.cityXian = this.query.area[2];
			},
			// 选择日期
			onChange(e) {
				if (e.length != 0) {
					this.query.startTime = e[0]
					this.query.endTime = e[1]
				} else {
					this.query.startTime = ''
					this.query.endTime = ''
				}
			},
			// 获取 easy-mock 的模拟数据
			getData() {
				this.$postForm('/admin/messages/organAll', this.query).then((res) => {
					if (res.code == 1000) {
						this.$forceUpdate(); //强制刷新
						this.tableData = res.data.list
						this.pageTotal = res.data.totalRow
					}
				}).catch((error) => {
					console.log(error)
				})

			},
			// 触发搜索按钮
			handleSearch() {
				this.query.pageNumber = 1;
				this.getData();
			},
			// 点击重置
			resetClick() {
				this.dateList = [];
				this.query = {
					pageNumber: 1,
					pageSize: 10,
					city: ''
				};
				this.getData();
			},
			// 多选操作
			handleSelectionChange(val) {
				this.multipleSelection = val;
				console.log(this.multipleSelection, 'this.multipleSelection')
			},
			handleAdd() {
				this.shopsShow = true
				this.dialogTitle = '新增商家'
				this.shopsForm = {}
				this.activeName = 'one'
			},
			// 点击批量修改业务员
			delAllSelection() {
				if (this.multipleSelection.length == 0) {
					this.$message.error('请先选择数据');
					return
				}
				this.clerkShow = true;
				// this.multipleSelection = [];
			},
			addQuestionSort() {
				var vm = this;
				this.$http.post(this.$host + '/admin/questionVideo/saveCategory', {
					id: vm.form.id,
					name: vm.form.name,
					sort: vm.form.sort
				}, {
					headers: {
						'Authorization': localStorage.getItem('htk_token'),
						'Content-Type': 'application/json'
					}
				}).then(function(response) {
					if (response.data.code != 1000) {
						vm.$message.error('新增类型异常');
						return;
					}
					vm.shopsShow = false;
					vm.getData();
				});
			},
			labelClick(row) {
				var authStatus = '';
				if (row.authStatus == false) {
					authStatus = false;
				} else {
					authStatus = true;
				}
				this.$post('/admin/messages/organUpdateShow', {
					id: row.id,
					authStatus: authStatus,
				}).then((res) => {
					if (res.code == 1000) {
						this.$message.success('操作成功')
						this.getData();
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 点击下线上线
			topThread(index, row) {
				// <!-- 0下线1上线organStatus -->
				var txt = '';
				var organStatus = '';
				if (row.organStatus == 0) {
					txt = '是否要上线'
					organStatus = 1;
				} else {
					txt = '是否要下线'
					organStatus = 0;
				}
				this.$confirm(txt, "提示", {
						confirmButtonText: "确认", //确认按钮文字更换
						cancelButtonText: "取消", //取消按钮文字更换
						showClose: true, //是否显示右上角关闭按钮
						type: "warning", //提示类型  success/info/warning/error
					}).then(async () => {
						this.$post('/admin/messages/organUpdate', {
							id: row.id,
							organStatus: organStatus,
						}).then((res) => {
							if (res.code == 1000) {
								this.$message.success('操作成功')
								this.getData();
							}
						}).catch((error) => {
							console.log(error)
						})
						//确认操作
					}).then((data) => {
						//取消操作
					})
					.catch(function(err) {
						//捕获异常
					});
			},
			onShopChange(val) {
				this.$forceUpdate()
			},
			// 编辑操作
			handleEdit(index, row, type) {
				// 00000000000000000000000
				// 
				if (type == 1) { //编辑商家
					this.isDisabled = false;
				} else {
					this.isDisabled = true;
				}

				this.$forceUpdate(); //强制刷新

				this.activeName = 'one';
				this.idx = index;
				// 机构名字===organName      公司名称===companyName     
				// 宣传图片===publicityImg1     机构封面图===organImg     
				// 培训年限===trainYear    企业联系电话===companyPhone    培训地址===trainAddress       
				// 认证类型===authType       所属区域===area       
				// 地址说明===addressComment      是否显示评价===isComment

				this.shopsForm = row;
				if (this.$.isEmpty(row.isComment)) {
					this.shopsForm.isComment = '0';
				}

				if (!this.$.isEmpty(row.publicityImg)) {
					this.shopsForm.publicityImg1 = row.publicityImg.split(',');
					this.shopsForm.isComment = row.isComment.toString();
				} else {
					this.shopsForm.publicityImg1 = [];
				}

				if (!this.$.isEmpty(row.labelInter)) {
					this.shopsForm.labelInter = Number(row.labelInter)
				}
				if (!this.$.isEmpty(row.labelWrit)) {
					this.shopsForm.labelWrit = Number(row.labelWrit)
				}

				if (!this.$.isEmpty(row.schoolVideo)) {
					this.shopsForm.schoolVideo1 = row.schoolVideo.split(',');
				}
				if (!this.$.isEmpty(row.interLabel)) {
					this.shopsForm.interLabel1 = row.interLabel.split(',');
				}
				if (row.authType == 1) {
					this.shopsIndexList = [1, 2, 4, 5];
				} else if (row.authType == 2) {
					this.shopsIndexList = [1, 3, 4, 5];
				} else if (row.authType == 3) {
					this.shopsIndexList = [1, 2, 3, 4, 5];
				}
				if (!this.$.isEmpty(row.writLabel) && !Array.isArray(row.writLabel)) {
					this.shopsForm.writLabel = row.writLabel.split(',');
				}


				// 0否1是-是否选择班次--笔试
				if (!this.$.isEmpty(row.writClass)) {
					if (row.writClass == 0) {
						this.shopsForm.writClass1 = false;
					} else {
						this.shopsForm.writClass1 = true;
					}
				}
				// 0否1是-是否选择班次--面试
				if (!this.$.isEmpty(row.interClass)) {
					if (row.interClass == 0) {
						this.shopsForm.interClass1 = false;
					} else {
						this.shopsForm.interClass1 = true;
					}
				}

				if (!this.$.isEmpty(row.organWrit)) {
					this.shopsForm.organWrit = row.organWrit;
				}

				if (!this.$.isEmpty(row.organInter)) {
					// this.shopsForm.organInter = row.organInter.toString();
					this.shopsForm.organInter = row.organInter;
				}


				// 笔试
				// popWrit    未认证弹窗提醒        authenWrit 显示未认证图标       hintWrit   提醒设置     
				if (!this.$.isEmpty(row.popWrit)) {
					if (row.popWrit == 0) {
						this.shopsForm.popWrit1 = false;
					} else {
						this.shopsForm.popWrit1 = true;
					}
				}
				if (!this.$.isEmpty(row.authenWrit)) {
					if (row.authenWrit == 0) {
						this.shopsForm.authenWrit1 = false;
					} else {
						this.shopsForm.authenWrit1 = true;
					}
				}


				// 面试
				// 未认证弹窗提醒   popInter       authenInter    显示未认证图标   提醒设置     hintInter
				if (!this.$.isEmpty(row.popInter)) {
					if (row.popInter == 0) {
						this.shopsForm.popInter1 = false;
					} else {
						this.shopsForm.popInter1 = true;
					}
				}
				if (!this.$.isEmpty(row.authenInter)) {
					if (row.authenInter == 0) {
						this.shopsForm.authenInter1 = false;
					} else {
						this.shopsForm.authenInter1 = true;
					}
				}
				this.shopsForm.hintInter = this.shopsForm.hintInter ? true : false
				this.shopsForm.hintWrit = this.shopsForm.hintWrit ? true : false
				if (!this.$.isEmpty(row.scoreStatus)) {
					this.shopsForm.scoreStatus = row.scoreStatus.toString();
				}

				if (!this.$.isEmpty(row.score)) {
					this.shopsForm.scoreNum1 = row.score;
				}


				if (!this.$.isEmpty(row.browsMin) || !this.$.isEmpty(row.browsMax) || !this.$.isEmpty(row.browsTime)) {
					this.shopsForm.switch1 = true;
				}
				if (!this.$.isEmpty(row.collectMin) || !this.$.isEmpty(row.collectMax) || !this.$.isEmpty(row
						.collectTime)) {
					this.shopsForm.switch2 = true;
				}
				if (!this.$.isEmpty(row.browsTime)) {
					this.shopsForm.browsTime = Number(row.browsTime);
				}

				if (!this.$.isEmpty(row.collectTime)) {
					this.shopsForm.collectTime = Number(row.collectTime);
				}

				// 所属区域-----shopsForm.area
				this.shopsForm.area = []
				this.shopsForm.area.push(row.province);
				this.shopsForm.area.push(row.city);
				this.shopsForm.area.push(row.region);

				this.shopsShow = true;
			},
			// 绑定管理员
			administratorClick(row) {
				// row.userId
				if (!this.$.isEmpty(row.userId)) {
					this.managerForm.userId = row.userId;
				} else {
					this.managerForm.userId = '';
				}
				this.managerForm.organId = row.id;

				this.managerForm.key = '';
				this.organBindingListWay();
			},
			// 绑定管理员搜索不刷新
			keyInput() {
				this.$forceUpdate();
			},
			organBindingListWay() {
				this.$postForm('/admin/messages/organBindingList', this.managerForm).then((res) => {
					if (res.code == 1000) {
						this.managerShow = true;
						this.managerList = res.data.list;
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 点击搜索绑定管理员
			managerSearch() {
				this.organBindingListWay();
			},
			// 点击重置绑定管理员
			managerResetClick() {
				this.managerForm.key = '';
				this.managerForm.pageNumber = 1;
				this.managerForm.pageSize = 10000;
				this.organBindingListWay();
			},

			// 班次管理
			classesClick(row) {
				this.organId = row.id
				this.classesForm.key = '';
				this.classesForm.id = row.id;
				this.classesForm.pageNumber = 1;
				this.classesForm.pageSize = 10000;
				this.classAllWay();
				this.classesShow = true;
			},
			changeMessage() {
				this.$forceUpdate();
			},
			classAllWay() {
				this.$postForm('/admin/messages/classAll', this.classesForm).then((res) => {
					if (res.code == 1000) {
						this.classesList = res.data.list;
						if (this.classesList && this.classesList.length != 0) {
							this.organId = this.classesList[0].organId
						}
					}
				}).catch((error) => {
					console.log(error)
				})
			},

			// 每日一练设置
			practiceDaily(id) {
				this.practiceDailyId = id;
				this.$get('/admin/messages/pageRandConfig', {
					organId: id,
					pageNumber: 1,
					pageSize: 10000,
				}).then((res) => {
					if (res.code == 1000) {
						this.practiceShow = true;
						this.practiceList = res.data.list;
					}
				}).catch((error) => {
					console.log(error)
				})
			},
			// 点击删除
			clickDel(id) {
				this.$confirm("是否删除该商家", "提示", {
						confirmButtonText: "确认", //确认按钮文字更换
						cancelButtonText: "取消", //取消按钮文字更换
						showClose: true, //是否显示右上角关闭按钮
						type: "warning", //提示类型  success/info/warning/error
					}).then(async () => {

						this.$post('/admin/messages/organDeleteAll', [id]).then((res) => {
							if (res.code == 1000) {
								this.$message.success('删除成功')
								this.getData();
							}
						}).catch((error) => {
							console.log(error)
						})
						//确认操作
					}).then((data) => {
						//取消操作
					})
					.catch(function(err) {
						//捕获异常
					});
			},

			// 分页导航
			handlePageChange(val) {
				this.$set(this.query, 'pageNumber', val);
				this.getData();
			}
		}
	};
</script>

<style scoped lang="scss">
	.handle-box {
		margin-bottom: 20px;
	}

	.handle-select {
		width: 120px;
	}

	.handle-input {
		width: 260px;
		display: inline-block;
	}

	.table {
		width: 100%;
		font-size: 14px;
	}

	.red {
		color: #ff0000;
	}

	.mr10 {
		margin-right: 10px;
	}

	.table-td-thumb {
		display: block;
		margin: auto;
		width: 40px;
		height: 40px;
	}

	.shopsBox ::v-deep .el-input__inner {
		/* width: 260px; */
	}

	.overHidden {
		overflow: hidden;
	}

	.floatLeft {
		float: left;
	}

	.videoBox {
		position: relative;
		width: 148px;
		height: 148px;

		/* background: indianred; */
	}

	.delBox {
		position: absolute;
		right: 0;
		top: 0;
		font-size: 22px;
		cursor: pointer;
	}

	.delBox:hover {
		color: red;
	}


	.videoBox1 {
		position: relative;
		width: 100px;
		height: 100px;
		/* background: indianred; */

		.delBox {
			position: absolute;
			right: 0;
			top: 0;
			font-size: 22px;
			cursor: pointer;
		}

		.delBox:hover {
			color: red;
		}
	}

	.img148 {
		width: 148px;
		height: 148px;
	}

	.expireBox {
		.el-input {
			width: 300px;
		}
	}

	.margin-bottom15 {
		margin-bottom: 15px;
	}
</style>